/**
 * 小程序配置文件
 */


var host = "api.wdb007.com/wdb-wxapp-api-test/"; //测试环境 - api
var actiHost = "api.wdb007.com/wdb-wxapp-test/";  //测试环境 - 活动
var wsUrl = "wss://ws.wdb007.com/ws_app_test"; //测试环境 推送服务器

// var host = "api.wdb007.com/wdb007/"; //生产环境 - api
// var actiHost = "api.wdb007.com/wdb-wxapp/";  //生产环境 - 活动
// var wsUrl = 'wss://ws.wdb007.com/app'  //线上生产推送服务器

let ossProdHost = 'https://sm.wdb007.com/html'      //生产环境oss域名前缀
let ossDevHost = 'https://sm.wdb007.com/dev'        //测试环境oss域名前缀
let ossHost = ossProdHost

var hostpay = host;// "api.wdb007.com/wdb-wxapp/wxapp"
wx.setStorageSync("hostUrl", `https://${host}`)
var config = {

    // 页面常量
    page: {
        bookDetail: '/pages/book_detail/book_detail', //图书详情
        index: '/pages/index/index',  //首页
        login: '/pages/login/login',  //登录
        pay: '/pages/request_payment/request_payment',  //充值
        bookgrid: '/pages/grid_choose/grid_choose',   //选格子页面
        wishList: '/pages/user_wish_list/user_wish_list',   //借书架(心愿单)
        borrowList: '/pages/borrow_list/borrow_list', // 借阅历史
        borrowSuccess: '/pages/borrow_success/borrow_success',//盘点页面
        borrowing: '/pages/borrowing/borrowing',//倒计时页面
        grabCard: '/pages/grab_card/grab_card',//裂变点击页面
        gridChoose: '/pages/grid_choose/grid_choose',//开柜门
        register: '/pages/register/register',//注册页面
        repair: '/pages/user_repair/user_repair',//报修页面
        shelfList: '/pages/shelf_list/shelf_list',//书柜列表
        userCenter: '/pages/user_center/user_center',//个人中心
        userRecord: '/pages/user_record/user_record',//用户消费记录
        vip: '/pages/vip/vip',//vip页面
        getMonthCard: '/pages/wx_activity/get_monthcard/get_monthcard',//用户发起抢月卡活动列表
        invitorShareResult: '/pages/wx_activity/invitor_share_result/invitor_share_result',//活动具体信息
        rankList: '/pages/wx_rankList/wx_rankList',//用户排行
        shelfMap: '/pages/shelf_map/shelf_map',
        webview: '/pages/webview/webview', //通用webview页面
        activity: '/pages/wx_activity/get_monthcard/get_monthcard',//活动充值
        activityList: '/pages/activity_list/activity_list', //活动列表页面
        userWallet: '/pages/user_wallet/user_wallet',  // 钱包
        walletDeposit: '/pages/wallet_deposit/wallet_deposit', // 押金充值
        topupSuccess: '/pages/topup_success/topup_success', // 充值成功
        invitePage: '/pages/invite_page/invite_page',      //邀请好友页面
        weekRankList: '/pages/week_rankList/week_rankList',  //周排行页面
        groupRankList: '/pages/group_rankList/group_rankList', //群排行页面
        activityLottery:'/pages/wx_activity/lottery/lottery',
        getVipSuccess:'/pages/getVip_success/getVip_success',
        buy_book_success:'/pages/success/buy_book_success/buy_book_success' // 购书成功页面
    },

    servicePhone: '4009216933',
    appversion: '1.3.0.0',
    appId: "wxe6948d920a0873f5",
    source: 'wx_app',

    // 下面的地址配合云端 Server 工作
    wsUrl: wsUrl,
    host,
    actiHostUrl: `https://${actiHost}`,
    hostUrl: wx.getStorageSync('hostUrl'),

    /**************后台接口定义***********************/
    // vip页面取消微信支付接口
    cancelPayment: `https://${host}/charge/cancelPayment`,

    // 购买vip之后支付信息查询
    queryPayStatus: `https://${host}/charge/queryPayStatus`,

    // 购买vip下单接口
    paymentVIPCard: `https://${host}/charge/paymentVIPCard`,

    // 用户切换优惠券时，计算需要展示的金额
    calcPayAmount: `https://${host}/charge/calcPayAmount`,

    // 获取用户优惠券信息列表
    getCouponList: `https://${host}/coupon/getChargeCouponList`,

    // 根据unionId获取用户信息
    unionIdLogin: `https://${host}charge/getUnionInfo`,

    // 获取群排行分享出去图片
    shareRankImg: `https://${host}user/shareRankImgInfo`,

    //保存群排行分享者信息
    queryGroupList: `https://${actiHost}/readActivity/save`,

    //   获取进入群排行个人信息
    queryPersonInWeekRankActivity: `https://${actiHost}/readActivity/queryPersonInWeekRankActivity`,

    // 保存群排行列表信息
    queryWeekRankListActivity: `https://${actiHost}/readActivity/queryWeekRankListActivity`,

    // 周排行数据
    queryWeekRankList: `https://${host}/user/queryWeekRankList`,

    // 周排行个人信息
    queryPersonInWeekRank: `https://${host}/user/queryPersonInWeekRank`,

    // 邀请好友接口
    getInviteInfo: `https://${host}/user/getInviteInfo`,

    // 根据微信加密信息获得解密信息
    getAESInfo: `https://${host}/charge/getAESInfo`,

    //保存微信用户信息
    saveWxUserInfo: `https://${host}/charge/saveWxUserInfo`,

    //获取openid
    getOpenid: `https://${host}/charge/getOpenid`,

    //根据书柜编号获取书柜信息
    getShelfInfo: `https://${host}/bookgrid/getShelfInfo`,

    //获取图书详情
    getBookDetail: `https://${host}/bookgrid/queryBookInfo`,

    //获取图书借阅人数
    queryBorrowedUser: `https://${host}/bookgrid/queryBorrowedUser`,

    //获取用户借阅列表
    getBorrowList: `https://${host}/user/getBorrowList`,

    //获取盘点时借还书列表
    borrowreturnv2: `https://${host}/bookgrid/borrowreturnv2`,

    //加入心愿单列表
    saveWishBook: `https://${host}/user/saveWishBook`,

    // 移除心愿单列表
    removeWishBook: `https://${host}/user/removeWishBook`,

    scanActivity: `https://${actiHost}/scan/scanActivity`,

    //获取活动列表接口
    activityList: `https://${actiHost}/activityList`,

    //获取抢月卡活动信息
    getCardActivityCurrentInfo: `https://${actiHost}/card/getCardActivityCurrentInfo`,

    //发起抢月卡活动
    cardShareInitiator: `https://${actiHost}/card/cardShareInitiator`,

    // 获取分享信息
    activityShareInfo: `https://${actiHost}/wxapp/activityShareInfo`,
    //根据活动id获取分享者信息
    getParentCardInfo: `https://${actiHost}/card/getParentCardInfo`,

    //获取排名信息
    getReadingList: `https://${actiHost}/wxapp/getReadingList`,

    // 获取图片上传sts
    getOssSts: `https://${host}/charge/getOSSInfo`,
    //
    saveShareInfo: `https://${actiHost}/share/saveShareInfo`,

    //获取活动列表数量
    activityCount: `https://${actiHost}/activityCount`,
    //getHduserid
    getHduserid: `https://${actiHost}/wxapp/saveWxUser`,

    //获取活动id（activityId）
    isActivity: `https://${actiHost}/isActivity`,

    //保存抢月卡助力信息
    saveAttendorInfo: `https://${actiHost}/card/saveAttendorInfo`,

    //根据经纬度获取最近书柜
    queryNearestShelf: `https://${host}/bookgrid/queryNearestShelf`,

    //获取书库列表接口
    queryShelfBookList: `https://${host}/bookgrid/queryShelfBookList`,

    //获取年龄段接口
    queryTopicalAgeList: `https://${host}/bookgrid/queryTopicalAgeList`,

    //获取书柜列表接口
    queryshelfList: `https://${host}/bookgrid/queryshelfList`,

    //获取验证码
    getRegisterCode: `https://${host}/user/getRegisterCode`,

    //小程序登录
    phoneLogin: `https://${host}/user/login`,

    //报修接口
    reportAbnormal: `https://${host}/user/reportAbnormal`,

    //账户信息
    queryUserDepositAmount: `https://${host}/user/queryUserDepositAmount`,

    //获取tag queryTagAgeList 
    queryTagAgeList: `https://${host}/bookgrid/queryTagAgeList`,

    //书籍详情queryShelfBookList
    queryShelfBookList: `https://${host}/bookgrid/queryShelfBookList`,

    //充值金额获取接口
    getChargeAmountList: `https://${host}/charge/getChargeAmountListV2`,

    //获取用户信息接口
    getUserInfo: `https://${host}/user/getUserInfo`,

    //退押金
    refundDeposit: `https://${host}/charge/refundDeposit`,

    //获取用户消费列表
    getExpenseRecord: `https://${host}/charge/getExpenseRecord`,

    //vip列表
    getVIPAmountList: `https://${host}/charge/getVIPAmountList`,

    //支付接口
    payment: `https://${host}/charge/payment`,

    // 支付接口V2
    paymentV2:`https://${host}/charge/paymentV2`,

    //获取借书架列表
    queryWishList: `https://${host}/user/queryWishListV2`,

    queryWishListV1: `https://${host}/user/queryWishList`,


    //获取书柜坐标
    getCoordinates: `https://${host}/bookshelf/getCoordinates`,

    //扫码
    getGridList: `https://${host}/bookgrid/getGridList`,

    //开柜
    unlock: `https://${host}/bookgrid/unlock`,

    //请求状态接口
    queryStatus: `https://${host}/bookgrid/queryStatus`,

    // 登录地址，用于建立会话
    loginUrl: `https://${host}/login`,

    // 测试的请求地址，用于测试会话
    requestUrl: `https://${host}/testRequest`,

    // 用code换取openId
    openIdUrl: `https://${hostpay}/openid`,

    // 测试的信道服务接口
    tunnelUrl: `https://${host}/tunnel`,

    // 生成支付订单的接口
    paymentUrl: `https://${hostpay}/payment`,

    // 生成图书购买信息
    prepareBuyBook: `https://${host}charge/prepareBuyBook`,

    // 发送模板消息接口
    templateMessageUrl: `https://${host}/templateMessage`,

    // 上传文件接口
    uploadFileUrl: `https://${host}/upload`,

    // 下载示例图片接口
    downloadExampleUrl: `https://${host}/static/weapp.jpg`,

    // 图书详情
    bookDetailUrl: `${ossHost}/book_detail.html`,

    // 用户协议
    licenseUrl: `${ossHost}/license.html`,

    //用户帮助中心
    helpCenterUrl: `https://h5.wdb007.com/html/help.html`,

    // 优惠券中心
    couponCenterUrl: `https://h5.wdb007.com/dev/app/index.html#/coupon`,

    // 退款
    refundUrl: `https://h5.wdb007.com/dev/app/index.html#/refund`,

};
module.exports = config
